import request from '@/utils/request'

// api地址
const api = {
  userInfo: 'user/info',
  assets: 'user/assets',
  bindMobile: 'user/bindMobile',
  personal: 'user/personal',
  
  attendance:'user/attendance',
  
  taskList:'user/taskList',
  completeTask:'user/completeTask',
  
  getAttendanceedList:'user/getAttendanceedList'
}

// 当前登录的用户信息
export const info = (param, option) => {
  const options = {
    isPrompt: true, //（默认 true 说明：本接口抛出的错误是否提示）
    load: true, //（默认 true 说明：本接口是否提示加载动画）
    ...option
  }
  return request.get(api.userInfo, param, options)
}

// 账户资产
export const assets = (param, option) => {
  return request.get(api.assets, param, option)
}

// 绑定手机号
export const bindMobile = (data, option) => {
  return request.post(api.bindMobile, data, option)
}

// 修改个人信息（头像昵称）
export const personal = (data, option) => {
  return request.post(api.personal, data, option)
}

// 今日签到
export const attendance = (data, option) => {
  return request.post(api.attendance, data, option)
}

// 签到任务列表
export const taskList = (data, option) => {
  return request.post(api.taskList, data, option)
}


// 任务完成领积分
export const completeTask = (data, option) => {
  return request.post(api.completeTask, data, option)
}

// /user/getAttendanceedList

export const getAttendanceedList = (data, option) => {
  return request.post(api.getAttendanceedList, data, option)
}
